package com.nowcoder.code.hjnc;

import java.util.Arrays;
import java.util.Scanner;

public class HJ03 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String nm = scanner.nextLine();
        String[] nms = nm.split(" ");
        int n = Integer.parseInt(nms[0]);
        int m = Integer.parseInt(nms[1]);
        int[][] ints = new int[n][3];
        int[] ss = new int[n];
        for (int i = 0; i < n; i++) {
            String[] xy = scanner.nextLine().split(" ");
            ints[i][0] = Integer.parseInt(xy[0]);
            ints[i][1] = Integer.parseInt(xy[1]);
            ints[i][2] = ints[i][0] + ints[i][1];
            ss[i] = ints[i][2];
        }
        Arrays.sort(ss);

        System.out.println(eat(n, m, ints, ss));

    }


    public static int eat(int n, int m, int[][] ints, int[] ss) {

        int s = ss[0] + m;

        int result = 1;
        for (int i = 1; i < n; i++) {
            if (ss[i] == ss[i - 1]) {
                continue;
            }
            if (ss[i] >= s) {
                result++;
                s = ss[i] + m;
            }
        }
        return result;
    }

}
